package cn.tude.oop;

import org.junit.jupiter.api.Test;

/*
本类用于面向对象的巩固练习
 */
public class TestCar {
    public static void main(String[] args) {
        Car car = new Car();
        /*car.color="黑得慌";
        car.brand="红旗l5";
        car.price=12112;
        car.length=0.2;
        System.out.println(car.brand);
        System.out.println(car.length);
        System.out.println(car.price);
        System.out.println(car.color);*/
        //car.start();
        car.stop();
        car.setBrand("大洋马");
        car.setColor("black");
        car.setPrice(200.20);
        car.setLength(9999.99);
        System.out.println(car.getBrand());
        System.out.println(car.getColor());
        System.out.println(car.getLength());
        System.out.println(car.getPrice());
    }
}

class Car {
    private String color;

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public double getLength() {
        return length;
    }

    public void setLength(double length) {
        this.length = length;
    }

    private String brand;
    private double price;
    private double length;

    private void start() {
        System.out.println("汽车开动了");
    }

    public void stop() {
        start();
        System.out.println("汽车停止了");
    }


}
